﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

using ECCIT.Extension.Weibo_v2.Common;
using ECCIT.Extension.Weibo_v2.Configuration;
using ECCIT.Extension.Weibo_v2.Lib;

namespace WinApp
{
    using Environment = ECCIT.Extension.Weibo_v2.Configuration.Environment;

    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            var accessToken = Microblog.GetAccessTokenByPassword("someone_ly@hotmail.com", "Honey815!");
            Environment.AccessToken = accessToken;
            //TestGetAuthorizationUri ();
        }

        public void TestGetAuthorizationUri ()
        {
            var authUri = Microblog.GetAuthorizationUri (Environment.RedirectUri, "code", "abc", "mobile");

            bool result = authUri.StartsWith (APIUri.Authorize);

            // https://api.weibo.com/oauth2/authorize?client_id=872044423&redirect_uri=http%3a%2f%2famicroblog.35free.net%2fAuthorizationCallback.html&response_type=code&state=abc&display=mobile#
        }
    }
}
